/**
2022 02 08
dec to bin for 64bit
range number[0,18446744073709551615]
*/
#include<stdio.h>
#include<stdlib.h>
//todo dec2BinStr
//todo dec2BinType
//todo bin2DecPrint

int dec2BinPrint(unsigned long long int n){
	unsigned short a[64]={0u};
	short i=0;
	for(n==0?i++:1;n>0;n/=2)a[i++]=n%2;
	for(i--;i>=0;i--)printf("%u",a[i]);
	return 0;
}

int main(int argc, char *args[]){
	int ret = 0;
	if(argc == 1){
		printf("Please input argc\n");
		ret = -1;
	}else if(argc==2){
		//todo check args
		unsigned long long int n = strtoull(args[argc-1],NULL,10);
		dec2BinPrint(n);
		printf("\n");
	}else{
		printf("Too many argcs!\n");
		ret = -2;
	}
	return ret;
}
